//package com.example.network.config;
//
//import jakarta.annotation.Resource;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//@Configuration
//public class WebConfig implements  WebMvcConfigurer {
//    @Resource
//    JwtInterceptor jwtInterceptor;
////    @Override
////    public void configurePathMatch(PathMatchConfigurer configurer) {
////        // 指定controller统一的接口前缀
////        configurer.addPathPrefix("/api", clazz -> clazz.isAnnotationPresent(RestController.class));
////    }
////    // 加自定义拦截器JwtInterceptor，设置拦截规则
////    @Override
////    public void addInterceptors(InterceptorRegistry registry) {
////        registry.addInterceptor(jwtInterceptor).addPathPatterns("/api/**")
////                .excludePathPatterns("/api/admin/login","/doc.html");
////        //拦截所有api开头的请求 进入拦截器验证 通过jwtInterceptor验证
//////        .excludePathPatterns("/api/admin/login")登录时还没有token,登录接口不需要拦截，其他都要
////    }
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(jwtInterceptor).addPathPatterns("/**")
//                .excludePathPatterns("/login", "/doc.html","/webjars"); // 根据需求排除不需要拦截的路径
//    }
//}